\hypertarget{_telnet_server_8h}{\section{Telnet\-Server.\-h File Reference}
\label{_telnet_server_8h}\index{Telnet\-Server.\-h@{Telnet\-Server.\-h}}
}


Header file for the Telnet server of the Tekdaqc.  


{\ttfamily \#include \char`\"{}stm32f4xx.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}Tekdaqc\-\_\-\-Debug.\-h\char`\"{}}\\*
{\ttfamily \#include $<$boolean.\-h$>$}\\*
{\ttfamily \#include \char`\"{}lwip/tcp.\-h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{struct_telnet_opts__t}{Telnet\-Opts\-\_\-t}
\begin{DoxyCompactList}\small\item\em Telnet options state structure. A structure that contains the state of the options supported by the telnet server, along with the possible flags. \end{DoxyCompactList}\item 
struct \hyperlink{struct_telnet_server__t}{Telnet\-Server\-\_\-t}
\begin{DoxyCompactList}\small\item\em Data structure to hold the state of the Telnet server. Contains all of the necessary state variables to impliment the Telnet server. Direct manipulation of these members is not recommended as it may leave the server in an inconsistent state. Instead, helper methods are provided which will ensure that all necessary operations occur as a result of any change. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__telnet__server_gae9088b6c383afeff8d58098f141afbd3}{\#define \hyperlink{group__telnet__server_gae9088b6c383afeff8d58098f141afbd3}{T\-E\-L\-N\-E\-T\-\_\-\-B\-U\-F\-F\-E\-R\-\_\-\-L\-E\-N\-G\-T\-H}~2056}\label{group__telnet__server_gae9088b6c383afeff8d58098f141afbd3}

\begin{DoxyCompactList}\small\item\em The length of the buffer to use for Telnet data. \end{DoxyCompactList}\item 
\hypertarget{group__telnet__server_ga0e9795e3bb758850785e6ebc676ab01b}{\#define \hyperlink{group__telnet__server_ga0e9795e3bb758850785e6ebc676ab01b}{N\-O\-T\-\_\-\-C\-O\-N\-N\-E\-C\-T\-E\-D}~0}\label{group__telnet__server_ga0e9795e3bb758850785e6ebc676ab01b}

\begin{DoxyCompactList}\small\item\em The Telnet server is not connected to a client. \end{DoxyCompactList}\item 
\hypertarget{group__telnet__server_gaf6202935c026af12978d46a765dafb90}{\#define \hyperlink{group__telnet__server_gaf6202935c026af12978d46a765dafb90}{C\-O\-N\-N\-E\-C\-T\-E\-D}~1}\label{group__telnet__server_gaf6202935c026af12978d46a765dafb90}

\begin{DoxyCompactList}\small\item\em The Telnet server is connected to a client. \end{DoxyCompactList}\item 
\#define \hyperlink{group__telnet__server_ga8b600918f84783490fd791ce773175ab}{T\-E\-L\-N\-E\-T\-\_\-\-I\-A\-C}~((char) 255)
\item 
\#define \hyperlink{group__telnet__server_ga9b82c3af8c3a14bc1f758d79a00e9ee9}{T\-E\-L\-N\-E\-T\-\_\-\-O\-P\-T\-\_\-\-B\-I\-N\-A\-R\-Y}~((char) 0)
\item 
\hypertarget{group__telnet__server_ga87cde070c7f961821be5f38065c6a4a0}{\#define \hyperlink{group__telnet__server_ga87cde070c7f961821be5f38065c6a4a0}{O\-P\-T\-\_\-\-F\-L\-A\-G\-\_\-\-W\-I\-L\-L}~((uint8\-\_\-t) 1)}\label{group__telnet__server_ga87cde070c7f961821be5f38065c6a4a0}

\begin{DoxyCompactList}\small\item\em The bit in the uc\-Flags member of the t\-Telnet\-Opts that is set when the remote client has sent a W\-I\-L\-L request and the server has accepted it. \end{DoxyCompactList}\item 
\hypertarget{group__telnet__server_gaab89806cad0a31ec6d4cae073ffbebcb}{\#define \hyperlink{group__telnet__server_gaab89806cad0a31ec6d4cae073ffbebcb}{O\-P\-T\-\_\-\-F\-L\-A\-G\-\_\-\-D\-O}~((uint8\-\_\-t) 2)}\label{group__telnet__server_gaab89806cad0a31ec6d4cae073ffbebcb}

\begin{DoxyCompactList}\small\item\em The bit in the uc\-Flags member of t\-Telnet\-Opts that is set when the remote client has sent a D\-O request and the server has accepted it. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{group__telnet__server_ga6a34decdb77d8c9df8ead5420ea8d326}{Telnet\-State\-\_\-t} \{ \\*
\hyperlink{group__telnet__server_gga6a34decdb77d8c9df8ead5420ea8d326ae583c55c9f9a3aa9888e4ed771d6a9b6}{S\-T\-A\-T\-E\-\_\-\-N\-O\-R\-M\-A\-L}, 
\hyperlink{group__telnet__server_gga6a34decdb77d8c9df8ead5420ea8d326ac445fb392e1398d85894ed95c217535d}{S\-T\-A\-T\-E\-\_\-\-I\-A\-C}, 
\hyperlink{group__telnet__server_gga6a34decdb77d8c9df8ead5420ea8d326aab00693e6446eb0b2dd86441e16fa7bd}{S\-T\-A\-T\-E\-\_\-\-W\-I\-L\-L}, 
\hyperlink{group__telnet__server_gga6a34decdb77d8c9df8ead5420ea8d326a1c98dcef9f1808d490980c9660d07356}{S\-T\-A\-T\-E\-\_\-\-W\-O\-N\-T}, 
\\*
\hyperlink{group__telnet__server_gga6a34decdb77d8c9df8ead5420ea8d326a690d160db6429d82862282d94e3b4c4f}{S\-T\-A\-T\-E\-\_\-\-D\-O}, 
\hyperlink{group__telnet__server_gga6a34decdb77d8c9df8ead5420ea8d326a8efcfd07c99adc3da1f982af25bb6054}{S\-T\-A\-T\-E\-\_\-\-D\-O\-N\-T}
 \}
\begin{DoxyCompactList}\small\item\em Telnet parser state enumeration. The possible states of the telnet option parser. \end{DoxyCompactList}\item 
enum \hyperlink{group__telnet__server_gab6653d6c1bd1261ebfcb4d667f848716}{Telnet\-Status\-\_\-t} \{ \hyperlink{group__telnet__server_ggab6653d6c1bd1261ebfcb4d667f848716a63347d81d258d4f3c53dca873fbe3b41}{T\-E\-L\-N\-E\-T\-\_\-\-O\-K}, 
\hyperlink{group__telnet__server_ggab6653d6c1bd1261ebfcb4d667f848716ade43926fa79e7274b5a207aa99dfbf80}{T\-E\-L\-N\-E\-T\-\_\-\-E\-R\-R\-\_\-\-C\-O\-N\-N\-E\-C\-T\-E\-D}, 
\hyperlink{group__telnet__server_ggab6653d6c1bd1261ebfcb4d667f848716a0ebd3cbc0fc21b74010e6faf772852e9}{T\-E\-L\-N\-E\-T\-\_\-\-E\-R\-R\-\_\-\-B\-I\-N\-D}, 
\hyperlink{group__telnet__server_ggab6653d6c1bd1261ebfcb4d667f848716a01d38959911101e3354606780cf67a6d}{T\-E\-L\-N\-E\-T\-\_\-\-E\-R\-R\-\_\-\-P\-C\-B\-C\-R\-E\-A\-T\-E}
 \}
\begin{DoxyCompactList}\small\item\em Telnet status enumeration. The possible success/error causes for the Telnet server's operation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__telnet__server_gab6653d6c1bd1261ebfcb4d667f848716}{Telnet\-Status\-\_\-t} \hyperlink{group__telnet__server_gae8002482499a83baab72c8714ef609d2}{Initialize\-Telnet\-Server} (void)
\begin{DoxyCompactList}\small\item\em Initialize a \hyperlink{struct_telnet_server__t}{Telnet\-Server\-\_\-t} struct with default values. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga26f786d2e47e4bb5f180d2740eebc957}{Telnet\-Close} (void)
\begin{DoxyCompactList}\small\item\em This function is called when the the T\-C\-P connection should be closed. \end{DoxyCompactList}\item 
\hyperlink{group__data__types_ga0ecf26b576b9a54eca656b9be7ba6a06}{bool} \hyperlink{group__telnet__server_ga6509e0047d80aea0570ec903a1e10887}{Telnet\-Is\-Connected} (void)
\begin{DoxyCompactList}\small\item\em Indicates if the Telnet server is occupied or not. \end{DoxyCompactList}\item 
err\-\_\-t \hyperlink{group__telnet__server_ga8946efc99077a959cb1cad3e059f9071}{Telnet\-Poll} (void $\ast$arg, struct tcp\-\_\-pcb $\ast$tpcb)
\begin{DoxyCompactList}\small\item\em Called when the lw\-I\-P T\-C\-P/\-I\-P stack needs to poll the server with/for data. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga93c1e298d9778f890b6df05b35072988}{Telnet\-Recv\-Buffer\-Write} (char character)
\begin{DoxyCompactList}\small\item\em Writes a character into the telnet receive buffer. \end{DoxyCompactList}\item 
char \hyperlink{group__telnet__server_gaff55b8914481cb32d621a855a69a5635}{Telnet\-Read} (void)
\begin{DoxyCompactList}\small\item\em Reads a character from the telnet interface. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_gaa2f418e9d287a2863fe1198e3c75f4ad}{Telnet\-Write} (const char character)
\begin{DoxyCompactList}\small\item\em Writes a character to the telnet interface. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga579198334cf97874ecc89e3b29351066}{Telnet\-Write\-String} (char $\ast$string)
\begin{DoxyCompactList}\small\item\em Writes a string to the telnet interface. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga8779bc1d2c7943063104c8624a877d8b}{Telnet\-Process\-Will} (char option)
\begin{DoxyCompactList}\small\item\em Handle a W\-I\-L\-L request for a telnet option. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_gac84ea97f4be2d0b62498cca6297d0ab7}{Telnet\-Process\-Wont} (char option)
\begin{DoxyCompactList}\small\item\em Handle a W\-O\-N\-T request for a telnet option. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_gabdf9478794e09f61ab850c78147a7c6f}{Telnet\-Process\-Do} (char option)
\begin{DoxyCompactList}\small\item\em Handle a D\-O request for a telnet option. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_gaf2500a4ad4bcbfd6ac4367f298e42f10}{Telnet\-Process\-Dont} (char option)
\begin{DoxyCompactList}\small\item\em Handle a D\-O\-N\-T request for a telnet option. \end{DoxyCompactList}\item 
\hypertarget{group__telnet__server_ga348f2b04116a013b6eabfa72c926a25f}{void \hyperlink{group__telnet__server_ga348f2b04116a013b6eabfa72c926a25f}{Telnet\-Process\-Character} (char character)}\label{group__telnet__server_ga348f2b04116a013b6eabfa72c926a25f}

\begin{DoxyCompactList}\small\item\em Process a character received from the telnet port. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga0660c325387baca6c54fe699ac048907}{Telnet\-Write\-Error\-Message} (char $\ast$message)
\begin{DoxyCompactList}\small\item\em Print a message to the telnet connection formatted as an error. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga0afb5de5ce2d81cdc5322e0534bae1d8}{Telnet\-Write\-Status\-Message} (char $\ast$message)
\begin{DoxyCompactList}\small\item\em Print a message to the telnet connection formatted as a status. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga7d350b6355ef213d4aa15e9b80c3d15e}{Telnet\-Write\-Debug\-Message} (char $\ast$message)
\begin{DoxyCompactList}\small\item\em Print a message to the telnet connection formatted as a debug. \end{DoxyCompactList}\item 
void \hyperlink{group__telnet__server_ga7f3d87d181908e8353a67bbaf15fac50}{Telnet\-Write\-Command\-Data\-Message} (char $\ast$message)
\begin{DoxyCompactList}\small\item\em Print a message to the telnet connection formatted as a command data message. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Contains public definitions and data types for the Tekdaqc Telnet server.

\begin{DoxyAuthor}{Author}
Jared Woolston (\href{mailto:jwoolston@tenkiv.com}{\tt jwoolston@tenkiv.\-com}) 
\end{DoxyAuthor}
\begin{DoxySince}{Since}
v1.\-0.\-0.\-0 
\end{DoxySince}


Definition in file \hyperlink{_telnet_server_8h_source}{Telnet\-Server.\-h}.

